package lab02.test06;

public class Triangle {
    double side1;
    double side2;
    double side3;
    double perimeter;
    double proportion;
    boolean x;

    public double getPerimeter() {
        perimeter = side1 + side2 + side3;
        System.out.println(perimeter);
        return perimeter;

    }

    public double getProportion() {
        double a;
        a = (side1 + side2 + side3) / 2;
        proportion = Math.sqrt(a * (a - side1) * (a - side2) * (a - side3));
        System.out.println(proportion);
        return proportion;
    }

    public void rewrite(double side1, double side2, double side3) {
        this.side1 = side1;
        this.side2 = side2;
        this.side3 = side3;
    }

    public boolean right() {
        if ((side1 + side2) > side3 && Math.abs(side1 - side2) < side3 && (side1 + side3) < side2
                && Math.abs(side1 - side3) > side2 && (side2 + side3) < side1 && Math.abs(side2 - side3) > side1) {
            System.out.println("It can be a triangle");
            return true;
        }
        System.out.println("It can't be a triangle");
        return false;
    }
}
